package com.kystar.muxplayer.protocol.code.set;

import com.kystar.muxplayer.model.Bound;
import com.kystar.muxplayer.model.Layer;
import com.kystar.muxplayer.model.LayerType;
import com.kystar.muxplayer.protocol.CodeCmd;
import java.io.InvalidObjectException;

//    1	图像参数
//    2	局部参数
//    3	抠图
//    4	边缘羽化
//    5	透明度
public class CS0FLayerParam extends CodeCmd {
    private CS0FLayerParam(int layerId,int typeId,int x,int y,int w,int h) {
        super(layerId,typeId,x>>8,x,y>>8,y,w>>8,w,h>>8,h);
    }

    @Override
    public byte getCode() {
        return 0xF;
    }



    @Override
    public void checkResult() throws InvalidObjectException {
        super.checkResult();
        verify(mResult[2],CODE_OK,"校验数据");
    }

    public static CS0FLayerParam createImageBounds(LayerType type,Bound bound) {
        return new CS0FLayerParam(type.id,1,bound.x,bound.y,bound.w,bound.h);
    }

}
